package App;

import java.io.IOException;
import java.util.List;

import DAO.DAOArquivo;
import Model.Hotel;

public class Aplicacao2 {
	public static void main (String[] args) throws IOException, ClassNotFoundException{
		DAOArquivo daoarquivo = new DAOArquivo();
		Hotel h1 = new Hotel(1, "rua rua", 12345, "Hotel A", "Gerente A");
		Hotel h2 = new Hotel(2, "rua rua", 22345, "Hotel A", "Gerente A");
		Hotel h3 = new Hotel(3, "rua rua", 22345, "Hotel A", "Gerente A");
		List<Hotel> hoteiss = new List<Hotel>();
		hoteiss.add(h2);
		hoteiss.add(h1);
		hoteiss.add(h3);
		
		daoarquivo.salvar("C:/Arquivos/hotel.txt", hoteiss);
		
		List<Hotel> hoteis = daoarquivo.ler("C:/Arquivos/hotel.txt");
		System.out.println(hoteis.size());
		
		
	}

}
